package com.cloudRestudy.provider.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cloudRestudy.common.core.result.R;

import com.cloudRestudy.provider.entity.SysUser;
import com.cloudRestudy.provider.service.SysUserService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : SysUserController
 * @Author : lby
 * @Date: 2021/7/8 11:08
 * @Description :
 */
@RestController
@RequestMapping("user")
@AllArgsConstructor
public class SysUserController {
    private final SysUserService sysUserService;


    @GetMapping("/list")
    public R getUserList(){
        return R.ok( sysUserService.list());
    }

    @GetMapping("/page")
    public R getUserPage(Page page, SysUser sysUser){
        QueryWrapper<SysUser> query = Wrappers.query();
        return R.ok(sysUserService.page(page,query));
    }
}
